package com.guapi.service;

import com.guapi.dao.Task;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class TaskService extends SelfBaseService<Task> {

    /**
     * 获取即将过期的任务列表，判断是否需要对完成状态设限制
     * @param expiredDate
     * @param judgeFinished
     * @return
     */
    public List<Task> getToExpired(Date expiredDate, boolean judgeFinished) {
        Task task = new Task();
        if (judgeFinished) {
            task.setFinished("1");
        }
        task.setExpired(expiredDate.toString());
        return this.getByExpired(task);
    }
}
